<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserTable extends Migration {

    /**
     * 后台用户表
     */
    public function up() {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name', 60)->comment("姓名");
            $table->string('username', 80)->comment("用户名");
            $table->string('password', 168)->comment("密码");
            $table->string('phone', 60)->unique()->comment("手机号");
            $table->string('images',500)->default('')->comment('头像');
            $table->integer('number')->default(0)->comment("私教次数");
            $table->integer('by_number')->default(0)->comment("被扣次数");
            $table->string('level', 168)->default('')->comment("用户等级");
            $table->string('synopsis',500)->default('')->comment("简介");
            $table->tinyInteger('users_status')->default(1)->comment("0私教/1超级管理员");
            $table->tinyInteger('status')->default(1)->comment("0禁用/1启用");
            $table->tinyInteger('delete')->default(1)->comment("0删除/1正常");
            $table->rememberToken();
            $table->timestamps();
        });
    }

    public function down() {
        Schema::dropIfExists('users');
    }

}
